package com.banmao.mall.mapper;

import com.banmao.mall.model.bo.client.coupon.CouponListBO;
import com.banmao.mall.model.pojo.CouponUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CouponUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(CouponUser record);

    int insertSelective(CouponUser record);

    CouponUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(CouponUser record);

    int updateByPrimaryKey(CouponUser record);

    List<CouponUser> getCouponList(Integer page, Integer limit, Integer couponId, Integer userId, String status, String sort, String order);

    int getTotal(Integer userId, String status);

    Integer getAvailableCouponLength(Integer userId);

    List<CouponUser> selectList(Integer userId, Integer couponId, Short status);


    List<CouponUser> selectByUserIdAndStatus(@Param("userId") Integer userId,
                                             @Param("status") Integer status,
                                             @Param("size") Integer size,
                                             @Param("page") Integer page);

    List<CouponUser> selectAllUserEffectiveCoupon(Integer userId);
}